<extend name="Public/base" />

<block name="body">
  <!-- 标题栏 -->
  <div class="main-title">
    <h2>推广联盟管理</h2>
  </div>
  
  <div class="cf">
    <div class="fl">
     <!--  <a id="add-group" class="btn" href="{:U('add')}">新 增</a> -->
      <a url="{:U('setStatus', array('status' => 1))}" class="btn ajax-post" target-form="ids" >启 用</a>
      <a url="{:U('setStatus', array('status' => 0))}" class="btn ajax-post" target-form="ids" >禁 用</a>
      <button class="btn ajax-post confirm" target-form="ids" url="{:U('setStatus', array('status' => -1))}">删 除</button>
      <a class="btn" href="{:U('userlist')}">刷 新 <span style="font-size:12px;font-weight:normal">(清空搜索条件)</span></a>
    </div>
    
    <!-- 高级搜索 -->
    <form id="J_search_form" action="{:U('userlist')}" method="POST">
      <div class="search-form fr cf">
        <div class="fl">
         
          <div class="sleft">
           <!--  <input type="text" name="start_time" class="search-input w-100 date_select" value="{:I('get.start_time')}" placeholder="起始时间"/>
            <span class="fl line-h">至</span>-->
            <input type="text" name="keywords" class="search-input w-100 " value="" placeholder="用户名或联系电话"  style="width:150px;"/> 
            <a class="sch-btn" href="javascript:;" id="J_search"><i class="btn-search"></i></a>
          </div>
        </div>
      </div>
    </form>
  </div>
  <!-- 数据列表 -->
  <div class="data-table table-striped">
    <table class="">
      <thead>
        <tr>
          <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
          
          <th>所属用户</th>
          <!-- <th>名称</th> -->
    
          <th>联系方式</th>
          <th>一级代理</th>
          <th>二级代理</th>
          <th>三级代理</th>
          <th>订单总数</th>
          <th>分销金额</th>
          <th>待提取金额</th>
          <th>二维码</th>
          <th width="140" class="text-center">操作</th>
        </tr>
      </thead>
      <tbody>
      <notempty name="lists">
        <volist name="lists" id="vo">
          <tr class="status_trclass_{$vo.status}">
            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
            
            <td>
              <a href="{:U('User/view', array('id' => $vo['uid']))}">
                <if condition="get_nickname($vo['uid']) neq ''">
                  {$vo.uid|get_nickname}
                <else/>
                  {$vo.uid|get_username}
                </if>
              </a>
            </td>
            <!-- <td><a href="{:U('edit?id='.$vo['id'])}">{$vo.link_name}</a> </td> -->
        
            <td>{$vo.link_mobile}</td>
            <td><a href="{:U('agents?type=1&uid='.$vo['uid'])}">{$vo.one}</a></td>
            <td><a href="{:U('agents?type=2&uid='.$vo['uid'])}">{$vo.two}</a></td>
            <td><a href="{:U('agents?type=3&uid='.$vo['uid'])}">{$vo.three}</a></td>
             <td>{$vo.orders|default=0}</td>
             <td>{$vo.money|default=0}</td>
             <td>{$vo.smoney|default=0}</td>
            <td><a href="javascript:;" onclick="UI.load('{:U('detail',array('qrcode_url'=>md5($vo['qrcode_url'])))}','扫描二维码查看')">[查看]</a></td>
            <td class="text-center">
              <eq name="vo.status" value="1">
                <a href="{:U('setStatus?status=0&ids='.$vo['id'])}" class="ajax-get">[禁用]</a>
              <else/>
                <a href="{:U('setStatus?status=1&ids='.$vo['id'])}" class="ajax-get">[启用]</a>
              </eq>
             <!--  <a href="{:U('edit?id='.$vo['id'])}">[编辑]</a> -->
              <a href="{:U('setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">[删除]</a>
            </td>
          </tr>
        </volist>
        <else/>
        <td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
      </notempty>
      </tbody>
    </table>

  </div>
  <div class="page">
    {$_page}
  </div>
</block>

<block name="script">
  <script language="javascript" type="text/javascript" src="__PUBLIC__/Admin/js/My97Date/WdatePicker.js"></script>
  <script type="text/javascript" charset="utf-8">
    //导航高亮
    highlight_subnav('{:U('Union/userlist')}');
    Core.setValue('type', '{:I('get.type', '')}');
    //时间选择
    $('.date_select').focus(function(){
      WdatePicker({skin: 'twoer', dateFmt: 'yyyy-MM-dd', maxDate: '%y-%M-%d'});
    });
  </script>
</block>
